package com.htzz.collection.collection;

import com.htzz.collection.bean.DevInfoEntity;
import com.htzz.collection.bean.KInfoEntity;
import com.htzz.collection.domain.DevInfoDto;
import com.htzz.collection.domain.ResultVO;
import com.htzz.collection.service.DevInfoService;
import com.htzz.collection.service.KInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 
 *采集点相关静态数据接口
 * @author xdz
 * @email ixudezhi@163.com
 * @date 2021-08-31 09:13:01
 */
@Slf4j
@Api(tags = "采集点管理接口")
@RestController
@RequestMapping("/kinfo")
public class KinfoController {
    @Autowired
    private KInfoService kInfoService;

    /**
     * 列表
     */
    @ApiOperation("列表")
    @GetMapping("/list/{devId}")
    public ResultVO list(@PathVariable("devId") String devId){
        try{
            List<KInfoEntity> list=kInfoService.selectByDevId(devId);
            Map<String,Object> map =new HashMap<>();
            map.put("data",list);

            return ResultVO.ok(map);
        } catch (Exception e) {
            log.info(e.getMessage());
            return ResultVO.error(e.getMessage());
        }
    }

}
